package com.xca.znb.presenter;

import com.xca.znb.entity.Cart;
import com.xca.znb.entity.Goods;
import com.xca.znb.entity.User;
import com.xca.znb.model.imodel.ICartEndPay;
import com.xca.znb.model.impl.CartEndPayImpl;

public class CartEndPayPresenter {
    private ICartEndPay iCartEndPay ;
    public CartEndPayPresenter(ICartEndPay iCartEndPay){
        this.iCartEndPay = iCartEndPay;
    }

    public boolean addOrder(int localId, int goodsId, int num, String remark, String buyer, String sales, String type, String time) {
        return iCartEndPay.addOrder(localId, goodsId, num, remark, buyer, sales, type, time);
    }

    public Goods getGoodsById(int id) {
        return iCartEndPay.getGoodsById(id);
    }

    public double getBalance(String phone) {
        return iCartEndPay.getBalance(phone);
    }

    public void insertAccount(String phone, double num, String type, String time_day, String time_sec) {
        iCartEndPay.insertAccount(phone, num, type, time_day, time_sec);
    }

    public Cart getCartById(int id) {
        return iCartEndPay.getCartById(id);
    }

    public User getUserByPhone(String phone) {
        return iCartEndPay.getUserByPhone(phone);
    }
}
